package day20.tarena.io;

import java.io.*;
import java.util.Scanner;

public class WriteInt {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		for (int a = 0; a < 10; a++) {

			System.out.println("please enter number:");
			int i = sc.nextInt();
			FileOutputStream fos = new FileOutputStream("../../abc.txt");
			DataOutputStream dos = new DataOutputStream(fos);
			dos.writeInt(i);
			dos.close();

			FileInputStream fis = new FileInputStream("../../abc.txt");
			DataInputStream dis = new DataInputStream(fis);
			System.out.println(dis.readInt());
			fis.close();

		}
	}
}
